package cn.tedu.lucky.draw.server.controller;

import cn.tedu.lucky.draw.server.common.annotation.OperationLog;
import cn.tedu.lucky.draw.server.common.result.JsonResult;
import cn.tedu.lucky.draw.server.protocol.po.ActivityPrize;
import cn.tedu.lucky.draw.server.service.IActivityPrizeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class ActivityPrizeController {

    @Autowired
    private IActivityPrizeService activityPrizeService;

    @OperationLog(operation = "绑定活动奖品")
    @PostMapping("/draw/activity-prize/save")
    public JsonResult save(@RequestBody List<ActivityPrize> activityPrizes){
        activityPrizeService.save(activityPrizes);
        return JsonResult.ok();
    }
}
